package easy

func NumberOfLines(widths []int, s string) []int {
	lines, chars := 1, 0
	for _, ch := range s {
		if chars+widths[ch-'a'] > 100 {
			lines++
			chars = widths[ch-'a']
		} else {
			chars += widths[ch-'a']
		}
	}
	return []int{lines, chars}
}
